@use '@scss/common' as *;

.repoCard {
  @include btnReset;
  & {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--theme-border-color);
    padding: 1rem 2rem 1rem 1.5rem;
    position: relative;
    cursor: pointer;
  }

  @include small-break {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  &::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--theme-text);
    transition: width 0.3s;
  }

  .scanlines {
    opacity: 0;
    transition: opacity 0.3s;
  }

  &:hover {
    .arrow {
      opacity: 1;
      transform: translate(0, 0);
    }

    .scanlines {
      opacity: 0.75;
    }

    &::after {
      width: 100%;
    }
  }
}

.shimmer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.repoContent {
  flex-grow: 1;
  margin-right: 1rem;
  // set a `height` so that cards with no description so not shift the layout
  // this is because description may or may not render depending on the data
  height: 4rem;
  display: flex;
  flex-direction: column;
  text-align: left;
  justify-content: center;
  overflow: hidden;
  gap: 0.25rem;

  @include small-break {
    height: auto;
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}

.repoName {
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repoDescription {
  @include small;
  & {
    margin-top: calc(var(--base) / 2);
    color: var(--theme-elevation-500);
    overflow: hidden;
    width: 100%;
    margin: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.arrow {
  opacity: 0;
  transform: translate(-0.5rem, 0.5rem);
  transition:
    transform 0.3s,
    opacity 0.3s;
}
